home *** CD-ROM | disk | FTP | other *** search
- //==================================================================
- // CommandGoalTrigger.
- // See CommandGoalTrigger.txt
- //==================================================================
- class CommandGoalTrigger extends Trigger placeable;
- var private string FirstMessage;
-
- // #1
- var private CodePlay Score;
- var private Story StoryToTell;
- enum PState{
- UP,
- DOWN
- };
-
- function PostBeginPlay()
- {
- // #2
- Score = spawn(class'CodePlay');
- Score.MakeCode();
-
- StoryToTell = spawn(class'Story');
- StoryToTell.MakeStory();
-
- FirstMessage = "Go!";
- Super.PostBeginPlay();
- Message = FirstMessage;
- }// end PostBeginPlay()
-
- function Touch( actor Other )
- {
- if (IsRelevant( Other ) )
- {
- if (Pawn(Other).bIsCrouched){ //down
- Message = MakeMessage(PState.DOWN);
- }//end if
- else{ // up state
- Message = MakeMessage(PState.UP);
- }//end else
-
- Super.Touch(Other);
- }//end outer if
- }// end Touch()
-
- private function string MakeMessage(PState state){
- local string ActionMessage;
- if( state == PState.UP ){
- // #3
- ActionMessage @= "Goal - Get down! ";
- ActionMessage @= Score.ProvideCodeMessage();
- }
- else if( state == PState.DOWN ){
- // #4
- ActionMessage @= "Goal - Get up! ";
- ActionMessage @= StoryToTell.TellStory();
- }
- else {
- ActionMessage = "Okay.";
- }
- return ActionMessage;
- }
-
-
-
-
-
-
-
-